home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Leonardo the Inventor
/
Leonardo The Inventor (93026)(Broderbund)(Riverdeep)(2004).iso
/
LEOWINMV
/
ICARUS.DIR
/
00199_Script_199
< prev
next >
Wrap
Text File
|
1996-03-28
|
4KB
|
179 lines
on ICARUS_PRELOAD
global falling
if falling then
gameOver
else
unload (marker (-1)), (the frame - 1)
preload marker (1)
end if
end ICARUS_PRELOAD
on ICARUS_PRELOAD_FIRST -- For first game frame
unload 1, (the frame - 1)
preload marker (1)
end ICARUS_PRELOAD
on resetGame
puppetSound 0
global manSprite
global dangerSprite1, dangerSprite2
global manConstraintSprite
set manSprite = 11
set dangerSprite1 = 4
set dangerSprite2 = 5
set manConstraintSprite = 13
global manSpeed
set manSpeed = 32
global manCastFirst, manCastLast, manCastCurrent
set manCastFirst = 1
set manCastLast = 16
set manCastCurrent = manCastFirst
global fallCastFirst, fallCastLast
set fallCastFirst = 17
set fallCastLast = 65
global leftKey, rightKey
set leftKey = "jaJA"
set rightKey = "lsLS"
puppetSprite manSprite, true
set the constraint of sprite manSprite to manConstraintSprite
when keyDown then checkManKey
setFalling False
end resetGame
on endGame
noPuppets
when keyDown then nothing
end endGame
on noPuppets
repeat with s = 1 to 24
puppetSprite s, false
end repeat
end noPuppets
on gameLoop
go "gameLoop"
end gameLoop
on doGameFrame
global falling
if falling then
advanceFallCast
else
advanceManCast
checkCollision
end if
end doGameFrame
on advanceManCast
global manCastFirst, manCastLast, manCastCurrent
global manSprite
set manCastCurrent = manCastCurrent + 1
if manCastCurrent > manCastLast then
set manCastCurrent = manCastFirst
end if
set the castNum of sprite manSprite to manCastCurrent
end advanceManCast
on checkManKey
global leftKey, rightKey
put the key into whichKey
if "!" contains whichKey then
go marker (1)
exit
end if
if leftKey contains whichKey then
moveManLeft
else if rightKey contains whichKey then
moveManRight
end if
end checkManKey
on moveManLeft
global manSprite, manSpeed
put the locH of sprite manSprite into man_LocH
set man_LocH = man_LocH - manSpeed
set the locH of sprite manSprite = man_LocH
end moveMan
on moveManRight
global manSprite, manSpeed
put the locH of sprite manSprite into man_LocH
set man_LocH = man_LocH + manSpeed
set the locH of sprite manSprite = man_LocH
end moveManRight
on checkCollision
global dangerSprite1, dangerSprite2
checkSpriteCollision dangerSprite1
checkSpriteCollision dangerSprite2
end checkCollision
on checkSpriteCollision whichSprite
global manSprite
if sprite manSprite intersects whichSprite then
collided whichSprite
end if
end checkSpriteCollision
on collided whichSprite
manStartFall
end collided
on manStartFall
global manSprite
global manCastFirst, manCastLast, manCastCurrent
global fallCastFirst, fallCastLast
setFalling true
set manCastCurrent = fallCastFirst
puppetSound "FALLING.AIF"
end manStartFall
on advanceFallCast
global fallCastLast, manCastCurrent
global manSprite
set manCastCurrent = manCastCurrent + 1
if manCastCurrent > fallCastLast then
gameOver
end if
set the castNum of sprite manSprite to manCastCurrent
end advanceFallCast
on setFalling trueOrFalse
global falling
set falling = trueOrFalse
end setFalling
on gameOver
endGame
puppetTransition 51, 4, 8, false
go frame "Instructions"
end gameOver
on returnFromIcarus
go frame "Wing Menu" of movie "I_WING"
end returnFromIcarus
on pauseFrame
go the frame
end pauseFrame